#ifndef __51KEY_H_
#define __51KEY_H_

#include "head.h"

sbit K_UP=P3^3;
sbit K_DOWN=P3^2;
sbit K_LEFT=P3^5;
sbit K_RIGHT=P3^4;
sbit K_SELECT=P3^6;
sbit K_BACK=P3^7;

#define K_NO_EVENT      0
#define K_EVENT_UP      1
#define K_EVENT_DOWN    2
#define K_EVENT_LEFT    3
#define K_EVENT_RIGHT   4
#define K_EVENT_SELECT  5
#define K_EVENT_BACK    6

uchar key_loop();

#endif